<script src="__PUBLIC__/js/artDialog/jquery.artDialog.js?skin=default"></script>
<script src="__PUBLIC__/js/artDialog/plugins/iframeTools.js"></script>
<style type="text/css">
a.a_upload,a.a_choose{
	border:1px solid #3d810c;
	box-shadow:0 1px #cccccc;
	-moz-box-shadow:0 1px #cccccc;
	-webkit-box-shadow:0 1px #cccccc;
	cursor:pointer; 
	display: inline-block;
	text-align: center;
	vertical-align:bottom;
	overflow:visible;
	border-radius:3px;
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	vertical-align:middle;
	background-color: #f1f1f1;
	background-image: -webkit-linear-gradient(bottom, #ccc 0%, #e5e5e5 3%, #fff 97%, #fff 100%);
	background-image: -moz-linear-gradient(bottom, #ccc 0%, #e5e5e5 3%, #fff 97%, #fff 100%);
	background-image: -ms-linear-gradient(bottom, #ccc 0%, #e5e5e5 3%, #fff 97%, #fff 100%);
	color: #000;
	border:1px solid #aaa;
	padding:2px 8px 2px 8px;
	text-shadow: 0 1px #ffffff;
	font-size: 14px;
	line-height: 1.5;
}

.cmbitem {
	width: 100px;
	text-align: center;
}
.optsitem {
	float: right;
	margin-right: 50px;
}
.poptvalue {
	width:20px;
	text-align:center;
}
</style>
<div class="pd-20">
    <form action="" method="post" class="form form-horizontal" action="{:U("Admin/Order/addCombopack")}">
    	<!-- 套餐id -->
    	<input type="hidden" name="cpid" value="{$combopack['id']}">
        <div class="row cl">
        	<label class="form-label col-3"><span class="c-red"></span>套餐号</label>
            <div class="col-6">
	            <!--input type="text" class="input-text" value="{$food['name']}" placeholder="" id="name" name="name" datatype="*2-16" nullmsg=""-->	
	            <input type="text" class="input-text" value="{$combopack['cpname']}" id="cpname" name="cpname" datatype="*2-16" nullmsg="">
            </div>
            <div class="col-3"></div>
        </div>
        <div class="row cl">
        	<label class="form-label col-3"><span class="c-red"></span>搭配号</label>
            <div class="col-6">
	            <input type="text" class="input-text" value="{$combopack['cp_collocation']}" placeholder="" id="cp_collocation" name="cp_collocation" datatype="*2-16" nullmsg="">
            </div>
            <div class="col-3"></div>
        </div>
        <div class="row cl">
            <div class="col-9 col-offset-3">
                <input name="fomr-add" class="btn btn-success " type="submit" value="&nbsp;提交&nbsp;">
            </div>
        </div>
    </form>
</div>
<script>
// 适配3.2
var site_url = '{:U("Admin/Upyun/upload", array(), false)}';
//用户-编辑
function manage_edit(title, url, id, w, h, pc) {
	var height = 440 + (h-1)*31;
	if(pc == null) {
		height -= 31;
	}
    layer_show(title, url, w, height);
}

function changesort(obj) {
	//window.location.href="/index.php?g=Admin&m=Order&a=showAll&state="+$(obj).val();
	var sortid = $(obj).val();
	$('#sid').val(sortid);
}

function changeCbpName(obj) {
	var cbpid = $(obj).val();
	$('#name').val(cbpid);
}

$(document).ready(function(){
/*
	$('.cbmitem-input').change(function(){
		var value = $(this).val();
		alert('value ' + value);
	});
	*/
	/*
	$('#foods').find('label').each(function(){
		$(this).children('input').removeAttr('disabled');
	});
	*/
	$('.cbmitem-input').each(function(){
		console.log('cbmitem-input');
		//$(this).parent().parent().children('.optsitem').find('input').removeAttr('disabled');
		
		$(this).change(function(){
			console.log('change');
			var foodCheckStatus = $(this).is(':checked');
			if(foodCheckStatus == true) {
				console.log('选中 ');
				$(this).parent().parent().children('.optsitem').find('input').removeAttr('disabled');
				$(this).parent().next().val(1);
			} else {
				console.log('未选中 ');
				$(this).parent().parent().children('.optsitem').find('input').attr('disabled', 'false');
				$(this).parent().next().val(0);
				/*
				$(this).parent().parent().children('.optsitem').find('input').each(function(){
					var status = $(this).attr('disabled');
					if(status) {
						$(this).attr('disabled', 'false');
					} else {
						$(this).attr('disabled', 'true');
					}
				});
				*/
			}
			//$(this).parent().parent().children('.optsitem').find('input').attr('disabled', 'true');
			//var value = $(this).val();
			//alert('value ' + value);
		});
	});
	/*
	$('.cbmitem-input').each(function(){
		console.log('cbmitem-input');
		this.change(function(){
			var value = $(this).val();
			console.log('value = ' + value);
		});
	});
	*/
});
</script>